<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>【STLPort】STLPort的使用 - www_elesos_com站长 - 博客园</title>
<link type="text/css" rel="stylesheet" href="/bundles/blog-common.css?v=my4FYfT2lmqb3sakS-rxSQYr2TpdJ4R7fpviWLuq5wg1"/>
<link id="MainCss" type="text/css" rel="stylesheet" href="/skins/Banlieue13/bundle-Banlieue13.css?v=bWQ4hMcYpBmghzqW80-m_DAId1_XrdIgDiLgCO5z6wM1"/>
<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/elesos/rss"/>
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/elesos/rsd.xml"/>
<link type="application/wlwmanifest+xml" rel="wlwmanifest" href="http://www.cnblogs.com/elesos/wlwmanifest.xml"/>
<script src="http://common.cnblogs.com/script/jquery.js" type="text/javascript"></script>  
<script type="text/javascript">var currentBlogApp = 'elesos', cb_enable_mathjax=false;</script>
<script src="/bundles/blog-common.js?v=TUYuDnHaLBHaZFATU-2ZEv0YIqcxJGTZ6ROYwfnVQH81" type="text/javascript"></script>
</head>
<body>
<a name="top"></a>
<!--PageBeginHtml Block Begin-->
<div id="myad1" style="text-align:center">
<h1><a style="color:red;font-size:300%" href="http://www.elesos.com/" target="_blank">此博客已迁移到【艺搜天下】www.elesos.com</a><h1>
<!--
<img src="http://images.cnblogs.com/cnblogs_com/elesos/444085/o_00e6709939af65c8ed51d43aabf74624.gif" width="155" height="80"><img src="http://images.cnblogs.com/cnblogs_com/elesos/444085/o_00e6709939af65c8ed51d43aabf74624.gif" width="155" height="80"><img src="http://images.cnblogs.com/cnblogs_com/elesos/444085/o_00e6709939af65c8ed51d43aabf74624.gif" width="155" height="80">
-->
</div>
<!--PageBeginHtml Block End-->

<!--done-->
<div id="home">
<div id="header">
	<div id="blogTitle">
	<a id="lnkBlogLogo" href="http://www.cnblogs.com/elesos/"><img id="blogLogo" src="/Skins/custom/images/logo.gif" alt="返回主页" /></a>			
		
<!--done-->
<h1><a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/elesos/">Hello</a></h1>
<h2></h2>



		
	</div><!--end: blogTitle 博客的标题和副标题 -->
</div><!--end: header 头部 -->

<div id="main">
	<div id="mainContent">
	<div class="forFlow">
		<div id="navigator">
			
<!--done-->
			<ul id="navList">
				<li><a id="MyLinks1_HomeLink" class="menu" href="http://www.cnblogs.com/">博客园</a></li>
				<li><a id="MyLinks1_IngLink" class="menu" href="http://home.cnblogs.com/ing/">闪存</a></li>
				<li><a id="MyLinks1_MyHomeLink" class="menu" href="http://www.cnblogs.com/elesos/">首页</a></li>
				<li><a id="MyLinks1_NewPostLink" class="menu" rel="nofollow" href="http://i.cnblogs.com/EditPosts.aspx?opt=1">新随笔</a></li>
				<li><a id="MyLinks1_ContactLink" accesskey="9" class="menu" rel="nofollow" href="http://space.cnblogs.com/msg/send/www_elesos_com%e7%ab%99%e9%95%bf">联系</a></li>
				<li><a id="MyLinks1_Admin" class="menu" rel="nofollow" href="http://i.cnblogs.com/">管理</a></li>
				<li><a id="MyLinks1_Syndication" class="menu" href="http://www.cnblogs.com/elesos/rss">订阅</a>
				<a id="MyLinks1_XMLLink" class="aHeaderXML" href="http://www.cnblogs.com/elesos/rss"><img src="http://www.cnblogs.com/images/xml.gif" alt="订阅" /></a></li>
			</ul>


			<div class="blogStats">
				
				
<!--done-->
随笔- 109&nbsp;
文章- 0&nbsp;
评论- 6&nbsp;

				
			</div><!--end: blogStats -->
		</div><!--end: navigator 博客导航栏 -->
		

<!--done-->
<div id="topics">
	<div class = "post">
		<h1 class = "postTitle">
			<a id="cb_post_title_url" class="postTitle2" href="http://www.cnblogs.com/elesos/archive/2012/11/06/2756282.html">【STLPort】STLPort的使用</a>
		</h1>
		<div class="clear"></div>
		<div class="postBody">
			<div id="cnblogs_post_body"><p>STLPort是<span style="color: #ff0000;">C++标准库</span>的一个<span style="color: #ff0000;">高效实现</span></p>
<p>具有高度的<span style="color: #ff0000;">可移植</span>性，最新版本是5.21版，</p>
<p>先下载&ldquo;STLport-5.2.1.tar.bz2&rdquo;，解压到D:\develop\STLport-5.2.1</p>
<p>使用时<span style="color: #ff0000;">要先编译</span>：</p>
<p>1,从开始菜单运行vs2005的命令行提示工具&ldquo;Visual Studio 2005 Command Prompt&rdquo;;</p>
<p>2,cd进入D:\develop\STLport-5.2.1目录；</p>
<p>3,执行&rdquo;configure msvc8&rdquo;(vc6使用msvc6,vc9即vs2008使用msvc9)</p>
<p>4,执行&rdquo;cd D:\develop\STLport-5.2.1\build\lib&rdquo;</p>
<p>5,执行&rdquo;nmake -f msvc.mak clean install&rdquo;;</p>
<p>编译生成的dll和lib在STLport-5.2.1\lib和STLport-5.2.1\bin下，最后可以将STLport-5.2.1\build\lib 下的obj目录删除以节约硬盘空间。</p>
<p>&nbsp;</p>
<p><span style="color: #ff0000;">vs配置</span>：</p>
<p>Tools/Options/Projects and Solutions/VC++ Directories/</p>
<p>选择Include files加入D:\develop\STLport-5.2.1\stlport（在前）和D:\develop\ boost_1_50_0\（在后）并调到最前</p>
<p>选择Library files加入D:\develop\STLport-5.2.1\lib并调到最前</p>
<p>&nbsp;</p>
<p>实际工程中：</p>
<p>再打开<span style="color: #ff0000;">Project/Properties</span></p>
<p>在配置属性/常规下将字符集设为<span style="color: #ff0000;">Not set</span>;</p>
<p>在C/C++下的&ldquo;代码生成&rdquo;处，选择运行时库为<span style="color: #ff0000;">MTd</span></p>
<p><span style="color: #ff0000;">Debug版</span>工程，需要在&ldquo;C/C++&rdquo;的预处理器中<span style="color: #ff0000;">定义宏</span>:__STL_DEBUG; 在Debug下与Boost配合使用，要定义宏:_STLP_DEBUG</p></div><div id="MySignature"></div>
<div class="clear"></div>
<div id="blog_post_info_block">
<div id="BlogPostCategory"></div>
<div id="EntryTag"></div>
<div id="blog_post_info">
</div>
<div class="clear"></div>
<div id="post_next_prev"></div>
</div>


		</div>
		<div class = "postDesc">posted @ <span id="post-date">2012-11-06 08:31</span> <a href='http://www.cnblogs.com/elesos/'>www_elesos_com站长</a> 阅读(<span id="post_view_count">...</span>) 评论(<span id="post_comment_count">...</span>)  <a href ="http://i.cnblogs.com/EditPosts.aspx?postid=2756282" rel="nofollow">编辑</a> <a href="#" onclick="AddToWz(2756282);return false;">收藏</a></div>
	</div>
	<script type="text/javascript">var allowComments=true,isLogined=false,cb_blogId=132012,cb_entryId=2756282,cb_blogApp=currentBlogApp,cb_blogUserGuid='d25a482a-9321-e211-aa8f-842b2b196315',cb_entryCreatedDate='2012/11/6 8:31:00';loadViewCount(cb_entryId);</script>
	
</div><!--end: topics 文章、评论容器-->
<a name="!comments"></a><div id="blog-comments-placeholder"></div><script type="text/javascript">var commentManager = new blogCommentManager();commentManager.renderComments(0);</script>
<div id="comment_form" class="commentform">
<a name="commentform"></a>
<div id="divCommentShow"></div>
<div id="comment_nav"><span id="span_refresh_tips"></span><a href="javascript:void(0);" id="lnk_RefreshComments" onclick="return RefreshCommentList();">刷新评论</a><a href="#" onclick="return RefreshPage();">刷新页面</a><a href="#top">返回顶部</a></div>
<div id="comment_form_container"></div>
<div class="ad_text_commentbox" id="ad_text_under_commentbox"></div>
<div id="site_nav_under"><a href="http://www.cnblogs.com/" target="_blank" title="开发者的网上家园">博客园首页</a><a href="http://q.cnblogs.com/" target="_blank" title="程序员问答社区">博问</a><a href="http://news.cnblogs.com/" target="_blank" title="IT新闻">新闻</a><a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a><a href="http://job.cnblogs.com/" target="_blank">程序员招聘</a><a href="http://kb.cnblogs.com/" target="_blank">知识库</a></div>
<div id="opt_under_post"></div>
<script type="text/javascript">
    var enableGoogleAd = canShowAdsense(); var googletag = googletag || {}; googletag.cmd = googletag.cmd || [];
    fixPostBodyFormat();
</script>
<div id="ad_under_post_holder">
<script type='text/javascript'>
    var googletag = googletag || {};
    googletag.cmd = googletag.cmd || [];
    (function () {
        if (enableGoogleAd) {
            var gads = document.createElement('script');
            gads.async = true;
            gads.type = 'text/javascript';
            var useSSL = 'https:' == document.location.protocol;
            gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js';
            var node = document.getElementsByTagName('script')[0];
            node.parentNode.insertBefore(gads, node);
        }
    })();
</script>
<script type='text/javascript'>
    try {
        if (enableGoogleAd) {
            googletag.cmd.push(function () {
                googletag.defineSlot('/1090369/cnblogs_blogpost_C1_sitehome', [300, 250], 'div-gpt-ad-1346480159711-0').addService(googletag.pubads());
                googletag.defineSlot('/1090369/cnblogs_blogpost_C2', [468, 60], 'div-gpt-ad-1410860226396-0').addService(googletag.pubads());
                googletag.pubads().enableSingleRequest();
                googletag.enableServices();
            });
        };
    } catch (e) { }
</script>
<div id="google_ad_c1" class="c_ad_block">
    <div id='div-gpt-ad-1346480159711-0' style='width:300px; height:250px;'>
    <script type='text/javascript'>
        try {
            if (enableGoogleAd) {
                googletag.cmd.push(function () { googletag.display('div-gpt-ad-1346480159711-0'); });            
            } else {
                $('#div-gpt-ad-1346480159711-0').hide();
            }
    } catch (e) { }
    </script>
    </div>
</div>
</div>
<div id="under_post_news"></div>
<div id="google_ad_c2" class="c_ad_block">
<div id='div-gpt-ad-1410860226396-0' style='width:468px; height:60px;'>
<script type='text/javascript'>
try {
    if (enableGoogleAd) {
        googletag.cmd.push(function () { googletag.display('div-gpt-ad-1410860226396-0'); });
    } else {
        $('#div-gpt-ad-1346480159711-0').hide();
    }
} catch (e) { }
</script>
</div>
</div>
<div id="under_post_kb"></div>
<div id="HistoryToday" class="c_ad_block"></div>
<script type="text/javascript">
$(function () {
    loadNewsAndKb();
    loadBlogSignature();
    LoadPostInfoBlock(cb_blogId, cb_entryId, cb_blogApp, cb_blogUserGuid);
    GetPrevNextPost(cb_entryId, cb_blogId, cb_entryCreatedDate);
    loadOptUnderPost();
    GetHistoryToday(cb_blogId, cb_blogApp, cb_entryCreatedDate);
    setTimeout(function () { incrementViewCount(cb_entryId); }, 200);
});
</script>
</div>

	</div><!--end: forFlow -->
	</div><!--end: mainContent 主体内容容器-->

	<div id="sideBar">
		<div id="sideBarMain">
			
<!--done-->
<div class="newsItem">
<h3 class="catListTitle">公告</h3>
	<div id="blog-news"></div><script type="text/javascript">loadBlogNews();</script>
</div>

			<div id="calendar"><div id="blog-calendar" style="display:none"></div><script type="text/javascript">loadBlogDefaultCalendar();</script></div>
			
			<DIV id="leftcontentcontainer">
				<div id="blog-sidecolumn"></div><script type="text/javascript">loadBlogSideColumn();</script>
			</DIV>
			
		</div><!--end: sideBarMain -->
	</div><!--end: sideBar 侧边栏容器 -->
	<div class="clear"></div>
	</div><!--end: main -->
	<div class="clear"></div>
	<div id="footer">
		
<!--done-->
Copyright &copy;2014 www_elesos_com站长
	</div><!--end: footer -->
</div><!--end: home 自定义的最大容器 -->
<!--PageEndHtml Block Begin-->
<div id="myad2" style="text-align:center">
<!--
<img src="http://images.cnblogs.com/cnblogs_com/elesos/444085/r_7908770_111000280174_2_%e5%89%af%e6%9c%ac.jpg" width="406" height="150">
-->
</div> 
<!-- Baidu Button BEGIN -->
<script type="text/javascript" id="bdshare_js" data="type=slide&amp;img=1&amp;pos=right&amp;uid=6563849" ></script>
<script type="text/javascript" id="bdshell_js"></script>
<script type="text/javascript">
var bds_config={"bdTop":245};
document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000);
</script>
<!-- Baidu Button END -->
<div id="cnzzwidget" style="text-align:center">
<script src="http://s17.cnzz.com/stat.php?id=5163090&web_id=5163090&online=1" language="JavaScript"></script>
</div>
<!--PageEndHtml Block End-->
</body>
</html>
